Xbasic

pdf_fillInFields_get Function

Syntax

dim result as C = pdf_fillinFields_get(pdfFilename as C [, flagExtendedInfo as L])

Arguments

pdfFilenameCharacter

The PDF to extract fill-in field info from.

flagExtendedInfoLogical

If .T., extended information about each fill-in field will be included in the returned result.

Returns

resultCharacter

Returns all fill-in fields found in the PDF in JSON format.

Description

Gets a list of the fill-in fields in a PDF file. If a PDF file is created with fill-infields, this function will extract the names of all of the fill-in fields in the file. You can optionally extract additional information about each field.

Examples (from Interactive window):

dim fn as c
fn = "c:\mypdffiles\pdfform1.pdf"

?pdf_fillinFields_get(fn)
= {
    "first_name": "",
    "last_name": "",
    "date": "",
    "football": "",
    "baseball": "",
    "basketball": ""
}

Get extended information (from Interactive window):

dim fn as c
fn = "c:\mypdffiles\pdfform1.pdf"

?pdf_fillinFields_get(fn,.t.)
= [
    {"title": "first_name","fieldType": "Text","fieldFlags": "0","fieldValue": ""},
    {"title": "last_name","fieldType": "Text","fieldFlags": "0","fieldValue": ""},
    {"title": "date","fieldType": "Text","fieldFlags": "0","fieldValue": ""},
    {"title": "football","fieldType": "Button","fieldFlags": "0","fieldValue": ""},
    {"title": "baseball","fieldType": "Button","fieldFlags": "0","fieldValue": ""},
    {"title": "basketball","fieldType": "Button","fieldFlags": "0","fieldValue": ""}
]